<template>
  <aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]">
    <div class="aui-sidebar__inner">
      <el-menu 
        :default-active="$store.state.sidebarMenuActiveName"
        :collapse="$store.state.sidebarFold"
        :unique-opened="true"
        :collapseTransition="false"
        @open="handleOpen" @close="handleClose"
        class="aui-sidebar__menu"
        active-text-color="#ffd04b">
        <sub-menu v-for="menu in $store.state.sidebarMenuList" :key="menu.permId.toString()" :menu="menu" />
        <!-- <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-location"><span>权限管理</span></i>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/Adashboard/user">用户管理</el-menu-item>
            <el-menu-item index="/Adashboard/role">角色管理</el-menu-item>
            <el-menu-item index="/Adashboard/menu" disabled>菜单管理</el-menu-item>
          </el-menu-item-group>
        </el-submenu>

        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-location"><span>系统设置</span></i>
          </template>
          <el-menu-item-group >
            <el-menu-item index="/Adashboard/menu" disabled>菜单管理</el-menu-item>
            <el-menu-item index="/Adashboard/params" disabled>参数管理</el-menu-item>
            <el-menu-item index="/Adashboard/dict" disabled>字典管理</el-menu-item>
            <el-menu-item index="/Adashboard/file" disabled>文件上传</el-menu-item>
          </el-menu-item-group>
        </el-submenu>

        <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-location"><span>日志</span></i>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/Adashboard/log-login">登录日志</el-menu-item>
            <el-menu-item index="/Adashboard/log-operation" >操作日志</el-menu-item>
            <el-menu-item index="/Adashboard/log-error" >异常日志</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        
        <el-submenu index="4">
          <template slot="title">
            <i class="el-icon-location"><span>系统监控</span></i>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/Adashboard/api" disabled>接口文档</el-menu-item>
          </el-menu-item-group>
        </el-submenu> -->
      
      </el-menu>
 
    </div>
  </aside>
</template>

<script>
import SubMenu from '@/views/components/NavAsideSubMenu.vue'
export default {
  name: 'asideNav',
  // props: {
  //   msg: String
  // },
  data() {
    return {
    }
  },
  components: {
    SubMenu
  },
  created() {
    this.$store.state.sidebarMenuList = window.SITE_CONFIG['menuList']
    // console.log(this.$store.state.sidebarMenuList)
  },
  methods: {
    handleOpen(key, keyPath) {
      // console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      // console.log(key, keyPath);
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
/* .box {
  position: fixed;
  top: 58px;
  height: calc(100vh - 100px);
  height: 89%;
  width: 180px;
  background-color: #545c64;
  overflow: auto;
} */
</style>
